import request from '@/utils/request'

export function findWords() {
  return request({
    baseURL: 'http://localhost:8886',
    url:  '/good/findRedisKeywords',
    method: 'get'
  })
}

export function lineWords() {
  return request({
    baseURL: 'http://localhost:8886',
    url:  '/good/Keywords',
    method: 'get'
  })
}

export function findType() {
  return request({
    baseURL: 'http://localhost:8886',
    url:  '/good/findType',
    method: 'get'
  })
}

export function findGoodCount() {
  return request({
    baseURL: 'http://localhost:8886',
    url:  '/good/findGoodCount',
    method: 'get'
  })
}

export function findGood1(query) {
  return request({
    baseURL: 'http://localhost:8886',
    url:  '/good/findGoods1',
    method: 'get',
     params: query
  })
}

export function findGood2(query) {
  return request({
    baseURL: 'http://localhost:8886',
    url:  '/good/findGoods2',
    method: 'get',
     params: query
  })
}

export function findAllType() {
  return request({
    baseURL: 'http://localhost:8886',
    url:  '/good/findGoodTypes',
    method: 'get'
  })
}


export function  search(searchname) {
  return request({
     baseURL: 'http://localhost:8886',
    url: '/good/esGoods',
    method: 'get',
    params: { searchname }
  })
}

export function getUp(data) {
  return request({
    baseURL: 'http://localhost:8886',
    url: '/good/up',
    method: 'post',
    data
  })
}

export function getDown(data) {
  return request({
    baseURL: 'http://localhost:8886',
    url: '/good/down',
    method: 'post',
    data
  })
}

export function getUpdate(data) {
  return request({
    baseURL: 'http://localhost:8886',
    url: '/good/updateGoods',
    method: 'post',
    data
  })
}


export function  getDel(goodId) {
  return request({
     baseURL: 'http://localhost:8886',
    url: '/good/delGoods',
    method: 'get',
    params: { goodId}
  })
}

export function createGoods(data) {
  return request({
    baseURL: 'http://localhost:8886',
    url: '/good/addGoods',
    method: 'post',
    data
  })
}


export function createGoodsType(data) {
  return request({
    baseURL: 'http://localhost:8886',
    url: '/good/addGoodsType',
    method: 'post',
    data
  })
}



